#include <QTranslator>
#include <QLocale>
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include <QtCore>
#include <QtDeclarative>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    // Detect system locale and loads the Traditional Chinese / Simplified Chinese / English UIs accordingly
    QTranslator translator;
    QString locale = getenv("LANG");

    if (locale == "zh_HK" || locale == "zh_TW" || locale == "zh_MO") {
        // Loading localized translation files from Resources
        translator.load("zh_HK.qm", ":/");
        app.installTranslator(&translator);
    }
    else if (locale == "zh_CN" || locale == "zh_SG") {
        // Loading localized translation files from Resources
        translator.load("zh_CN.qm", ":/");
        app.installTranslator(&translator);
    }

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/TimeCalc/main.qml"));
    // viewer.showExpanded();
    viewer.showFullScreen();

    return app.exec();

}
